/*function takePhoto(){
	var platForm = getItemFromLocalStorage("platForm");
	if(platForm == "android"){
		window.tlxapp.selectPic("getOcrInfo","0","0");
	}else{
		selectPic("getOcrInfo","0","0");
	}
	}*/
function getOcrInfo(data){
	//$("#analyzeIng").hide();
	var platForm = getItemFromLocalStorage("platForm");
	var elem;
	if(platForm == "android"){
		//data = data.substring(10, data.length-2);
		elem = eval("("+data+")");
	}else{
		elem = eval("("+data+")");
	}
	var msg = data.exeRsMsg;
	
	//OCR是否有值
	if(elem == null){
		showTips("open1","信息读取失败！");
	}
	
	if(false != elem){
		//正面
		
		if(!elem.id_number || !elem.name){
			showTips("open1","信息读取失败！");
		}else{
			//showTips("open1","信息读取成功！");
		}
		//姓名、性别、民族（不识别）、出生日期、住址、身份证号
		$('#cName').val(elem.name);
		if(elem.sex&&elem.sex.indexOf('男')>-1)
			$('#sex').html('男').attr('value','1');
		else if(elem.sex&&elem.sex.indexOf('女')>-1)
			$('#sex').html('女').attr('value','2');
		$('#nationality_dummy').val(elem.people);
		if(elem.id_number)
			$('#birthdate').val(getBirthdayFromIdCard(elem.id_number).replace(/-/g,'/'));
		$('#address').val(elem.address?elem.address:'');
		$('#idCard').val(elem.id_number?elem.id_number:'');
	}else{
		showTips("open1",msg);
	}
} 
/**
 * 拍照
 */
function takePhoto(){
	var platForm = getItemFromLocalStorage("platForm");
	if(platForm == "android"){
		window.tlxapp.selectPic("getInfoFromCamera","0","0");
	}else{
//		var url="uploadPhoto::getInfoFromCamera::0";
//		document.location = url;
		selectPic("getInfoFromCamera","0","0");
	}
}
function getInfoFromCamera(imgBase64str){
	imgBase64str = 'data:image/png;base64,' + imgBase64str;
	var imgid = "img";
	try{
		var i = document.getElementById(imgid);
		i.src = imgBase64str;
		if(imgBase64str.length>1024*512){
			var quality =  50;
			i.src = jic.compress(i,quality).src; 
		}
		if(curPoto == '1')
			image1 = imgBase64str;
		else if(curPoto == '2')
			image2 = imgBase64str;
		else if(curPoto == '3')
			image3 = imgBase64str;

		var img = $('#'+imgid);
		AutoResizeImage(img.parent().width(),img.parent().height(),img[0]);
	}catch(e){
	}
}